
// 引入框架
const express = require('express')
const app = express();
const expressWs = require('express-ws')
const port = 8080
const websocket = require('./websocket')
expressWs(app) // 注册wx的服务入口

// 中间件'
app.use('/a', express.static('public/a.html'))
app.use('/b', express.static('public/b.html'))
app.use(express.static('public')) // 静态资源

app.use('/ws', websocket)

app.get('/*', (req, res)=>{})

for(let i = 0 ; i < 10 ; i++ ) {
  console.log(i)
}

console.log('大家')

// 监听端口号
app.listen(port, () => {
  console.log(`running http://localhost:${port}` );
})